<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns:u="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns="http://www.w3.org/1999/xhtml">

<u:composition>
	<h:form id="contactoForm">
		<p:dialog id="contactoDialogID" header="Agregar contacto"
			widgetVar="contactoDialog" resizable="false" width="900" modal="true"
			onCloseUpdate="#{onCloseUpdate}">
			<h:panelGrid id="panelGridContacto" columns="6">
				<h:outputText value="#{msgs.admContactos_nombre}" />
				<p:inputText id="nombreContactoIT"
					value="#{contactoController.view.nombre}" maxlength="200" size="50">
					<f:validateBean for="nombreContactoIT" />
					<f:ajax execute="@this" />
				</p:inputText>
				<h:message id="mncIT" for="nombreContactoIT" />

				<h:outputText value="#{msgs.admContactos_apellido}" />
				<p:inputText id="apellidoContactoIT"
					value="#{contactoController.view.apellido}" maxlength="200"
					size="50">
					<!-- <f:validateBean for="apellidoContactoIT" /> -->
					<f:ajax execute="@this" />
				</p:inputText>
				<h:message id="macIT" for="apellidoContactoIT" />

				<h:outputText value="#{msgs.admContactos_mail}" />
				<p:inputText id="mailIT" value="#{contactoController.view.mail}"
					maxlength="200" size="50">
					<f:validateBean for="mailIT" />
					<f:ajax execute="@this" />
				</p:inputText>
				<h:message id="mmIT" for="mailIT" />

				<h:outputText value="#{msgs.admContactos_notificar}" />
				<p:selectBooleanCheckbox
					value="#{contactoController.view.notificar}">
					<f:ajax execute="@this" />
				</p:selectBooleanCheckbox>
				<h:outputText value="" />

				<h:outputText value="#{msgs.admContactos_telefonoPrincipal}" />
				<p:inputText id="telefonoPrincipalIT"
					value="#{contactoController.view.telefonoPrincipal}"
					maxlength="200" size="50">
					<f:ajax execute="@this" />
					<!-- <f:validateBean for="telefonoPrincipalIT" /> -->
				</p:inputText>
				<h:message id="mtpIT" for="telefonoPrincipalIT" />

				<h:outputText value="#{msgs.admContactos_tipoTelefono}" />
				<p:selectOneMenu
					value="#{contactoController.view.tipoTelefonoPrincipal}"
					converter="com.converter.TipoTelefonoConverter">
					<f:selectItems value="#{contactoController.listaTipoTelefono}" />
					<f:ajax execute="@this" />
				</p:selectOneMenu>
				<h:outputText value="" />

				<h:outputText value="#{msgs.admContactos_telefonoSecundario}" />
				<p:inputText id="telefonoSecundarioIT"
					value="#{contactoController.view.telefonoSecundario}"
					maxlength="200" size="50">
					<f:ajax execute="@this" />
					<!-- <f:validateBean for="telefonoSecundarioIT" /> -->
				</p:inputText>
				<h:message id="mtsIT" for="telefonoSecundarioIT" />

				<h:outputText value="#{msgs.admContactos_tipoTelefono}" />
				<p:selectOneMenu
					value="#{contactoController.view.tipoTelefonoSecundario}"
					converter="com.converter.TipoTelefonoConverter">
					<f:selectItems value="#{contactoController.listaTipoTelefono}" />
					<f:ajax execute="@this" />
				</p:selectOneMenu>
				<h:outputText value="" />

				<h:outputText value="#{msgs.admContactos_telefonoOtro}" />
				<p:inputText id="telefonoOtroIT"
					value="#{contactoController.view.telefonoOtro}" maxlength="200"
					size="50">
					<f:ajax execute="@this" />
					<!-- <f:validateBean for="telefonoOtroIT" /> -->
				</p:inputText>
				<h:message id="mtoIT" for="telefonoOtroIT" />

				<h:outputText value="#{msgs.admContactos_tipoTelefono}" />
				<p:selectOneMenu value="#{contactoController.view.tipoTelefonoOtro}"
					converter="com.converter.TipoTelefonoConverter">
					<f:selectItems value="#{contactoController.listaTipoTelefono}" />
					<f:ajax execute="@this" />
				</p:selectOneMenu>
				<h:outputText value="" />

				<p:commandButton value="#{msgs.common_agregar}"
					actionListener="#{contactoController.addContacto}"
					update="#{update}" process="@this" />

				<p:commandButton value="#{msgs.common_cerrar}" type="button"
					actionListener="#{contactoController.cerrar}"
					onclick="PF('contactoDialog').hide()" />

			</h:panelGrid>

		</p:dialog>

	</h:form>

</u:composition>

</html>